package com.xuelang.pipeline.artifact.app.nexus3v1;

import com.xuelang.pipeline.artifact.app.nexus3v1.config.Nexus3v1RestFeignConfig;
import com.xuelang.pipeline.artifact.app.nexus3v1.fallback.SearchAssetServiceFallbackFactory;
import com.xuelang.pipeline.artifact.app.nexus3v1.request.SearchAssetQuery;
import com.xuelang.pipeline.artifact.app.nexus3v1.response.SearchAssetResponse;
import com.xuelang.pipeline.artifact.app.nexus3v1.xo.ApiResponseXO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * 封装NexusOSS 3.37.3-02以上安全-搜索相关接口-对应search
 *
 * @author xiwen.zxg
 * @since 2024/7/9
 */
@FeignClient(
        name = "search-asset-service",
        url = "${feign.rpc.nexus3V1RestService}",
        configuration = Nexus3v1RestFeignConfig.class,
        fallbackFactory = SearchAssetServiceFallbackFactory.class)
public interface SearchAssetService {

    /**
     * 搜索资产信息
     *
     * @param query
     * @return
     */
    @GetMapping(value = "/v1/search/assets", produces = "application/json;charset=utf-8")
    ApiResponseXO<SearchAssetResponse> searchAsset(@SpringQueryMap SearchAssetQuery query);


}
